import Mock from 'mockjs';
//import shellAssetsJson from '../../data/media/shellAssets.json';
import shellAssetsJson from '../../data/media2/shellAssets.json';


export default {
    className: "Media.Audit.ParentAssetIssuance",
    queryData: function(postData) {
      return {
        isSuccess: "Y",
        reason: "",
        message: [],
        data: {
            recordCount: shellAssetsJson.length,
            pageCount: 1,
            pageIndex: 1,
            pageSize: 20,
            queryResult: shellAssetsJson
        }
    };
    },
    queryByKeyID: function(postData) {
      console.log(postData);
      var curFindObject = null;
      for (var i = 0; i < shellAssetsJson.length; i++) {
          if (postData.keyID == shellAssetsJson[i].keyID) {
              curFindObject = shellAssetsJson[i];
              break;
          }
      }
      if (curFindObject == null) {
          return Mock.mock({
              isSuccess: "Y",
              reason: "",
              message: [],
            "data": {
              "keyID|1000-9999": 1000,
              "code": /^[1-9]$/,
              "name": Mock.mock('@ctitle'),//"资产名称",
              "type": "电影",//"资产类型",
              "source": "爱奇艺",//"资产来源",
              "sourceInfo": "爱奇艺",//"资产提供方信息",
              "expireTime": Mock.mock('@now(yyyy-MM-dd)'),//"版权开始时间",
              "expireEndTime": Mock.mock('@now(yyyy-MM-dd)'),//"版权结束时间",
              "classification": "欧美、科幻、喜剧、动作",//"资产类型",
              "initials": /^[A-Z]$/,//"首字母",
              "years": "2008",//"年份",
              "area": "欧美",//"地区",
              "language": "英语",//"语言",
              "episode": "1",//"集数",
              "director": Mock.mock('@ctitle'),//"导演",
              "edit": Mock.mock('@ctitle'),//"编辑",
              "actor": Mock.mock('@ctitle'),//"演员",
              "playStatus": "已完结",//"播出状态",
              "boxOffice": "7.7亿",//"票房",
              "score": "4.2",//"评分",
              "introduction": Mock.mock('@ctitle'),//"简介",
              "plot": Mock.mock('@ctitle'),//"剧情",
              "status": "已审核",
              "createTime": Mock.mock('@now'),//"创建时间",
              "lastUpdateTime": Mock.mock('@now'),//"修改时间",
              "version": 1,
            }
        });
      }else {
        return {
            isSuccess: "Y",
            reason: "",
            message: [],
            data: curFindObject,
        };
    }
    },
};
